package sg.edu.nus.iss.umpire.domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import com.google.appengine.api.datastore.Key;

@Entity
public class CompetitionDay implements Serializable {

	private static final long serialVersionUID = -7930777679663524090L;

	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Key competitionDayKey;
//	private Long competitionKey;
	private String competitionName;
	private Date startDate;
	private Date endDate;
	private String location;
	private String refereeName;
	private String date; // in the format dd/MM/yyyy; put as string for convinience;
	
	@OneToMany(cascade = CascadeType.ALL)
	private List<Session> sessions = new ArrayList<Session>();

	public Key getCompetitionDayKey() {
		return competitionDayKey;
	}

	public void setCompetitionDayKey(Key competitionDayKey) {
		this.competitionDayKey = competitionDayKey;
	}

//	public Long getCompetitionKey() {
//		return competitionKey;
//	}
//
//	public void setCompetitionKey(Long competitionKey) {
//		this.competitionKey = competitionKey;
//	}

	public String getCompetitionName() {
		return competitionName;
	}

	public void setCompetitionName(String competitionName) {
		this.competitionName = competitionName;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getRefereeName() {
		return refereeName;
	}

	public void setRefereeName(String refereeName) {
		this.refereeName = refereeName;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public List<Session> getSessions() {
		return sessions;
	}

	public void setSessions(List<Session> sessions) {
		this.sessions = sessions;
	}
	
	
}
